﻿@inject IStringLocalizer<EditorOnValueChanged> Localizer

<Editor @bind-Value="@EditorValue" />

<label class="form-label mt-3">@Localizer["EditorOnValueChangedLabel"]</label>
<textarea class="form-control mt-3">@EditorValue</textarea>
<div class="mt-3">
    <Button OnClick="SetValue">Reset</Button>
</div>

@code {
    private string? EditorValue { get; set; }

    private void SetValue()
    {
        EditorValue = Localizer["EditorOnValueChangedUpdateValue"];
    }

    /// <summary>
    /// <inheritdoc/>
    /// </summary>
    protected override void OnInitialized()
    {
        base.OnInitialized();

        EditorValue = Localizer["EditorOnValueChangedInitValue"];
    }
}
